﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GroupManager.Resource.CSDL;
namespace GroupManager.Class
{
    public class LopChucVu
    {
        // Thêm chức vụ
        public static void ThemChuVu(string _chucvu)
        {
            ChucVu _cv = new ChucVu();
            _cv.ChucVu1 = _chucvu;
            dbGroupManagerDataContext db = new dbGroupManagerDataContext();
            db.ChucVus.InsertOnSubmit(_cv);
            db.SubmitChanges();
        }
        // Sửa chức vụ
        public static void SuaChucVu(string _chucvu1, string _chucvu2)
        {
            dbGroupManagerDataContext db = new dbGroupManagerDataContext();

        }
        // Xóa chức vụ
        public static void XoaChucVu(string _chucvu)
        {
            dbGroupManagerDataContext db = new dbGroupManagerDataContext();
            ChucVu _cv = db.ChucVus.First(p => p.ChucVu1 == _chucvu);
            db.ChucVus.DeleteOnSubmit(_cv);
            db.SubmitChanges();
        }
    }
}